package com.example.e.HttpUse

import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.Exception
import java.lang.StringBuilder
import java.net.HttpURLConnection
import java.net.URL
import kotlin.concurrent.thread

object HttpUtil {

    fun sendByOkHttp(address:String,callback: Callback){
        val client = OkHttpClient()
        //构建请求
        val request = Request.Builder()
            .url(address)
            .build()
        //执行
        client.newCall(request).enqueue(callback)
    }

}